package m4d2;

import java.util.Locale;
import java.util.function.Consumer;

//Consumer接口默认方法    把两个fConsumer接口组合在一起对数据消费
public class gandThen {


    public static void method(String str, Consumer<String> con1, Consumer<String> con2){
        //分开来写
        /*con1.accept(str);
        con2.accept(str);*/

        //连接  谁先前面，谁消费
        con1.andThen(con2).accept(str);
    }

    public static void main(String[] args) {
        method("abcd",
                (t)->{
                    System.out.println(t.toUpperCase());
        },
                (t)->{
                    System.out.println(t.toLowerCase());
                });
    }
}
